<?php 
include_once '../info_struct.php';
include_once '../LDB_API/output.php';

$id = $_GET["id"];

$ref = ldb_get_by_id($id);

?>


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Cp1252">
<title><?php echo $ref->id . " - " . $ref->title;?></title>
<style type="text/css">
table td {
    padding : 5px;
    }
table tr {
    margin : 10px;
    }
</style>
</head>
    <body>
        <table>
            <tr>
                <td>ID:</td>
                <td><?php echo $ref->id;?></td>
            </tr>
            <tr>
                <td>Author:</td>
                <td><?php echo $ref->author;?></td>
            </tr>
            <tr>
                
                <td>Title:</td>
                <td><i><?php echo $ref->title;?></i></td>
            <tr>
                <td>Year:</td>
                <td><?php echo $ref->year;?></td>
            </tr>
            <?php 
            
            if ($ref->journal) {
                echo "<tr><td>Journal:</td><td>$ref->journal</td></tr>";
            }
            if ($ref->volume) {
                echo "<tr><td>Volume:</td><td>$ref->volume</td></tr>";
            }
            if ($ref->number) {
                echo "<tr><td>Number:</td><td>$ref->number</td></tr>";
            }
            if ($ref->pages) {
                echo "<tr><td>Pages:</td><td>$ref->pages</td></tr>";
            }
            if ($ref->doi) {
                echo "<tr><td>DOI:</td><td>
                <a href='http://dx.doi.org/$ref->doi'>$ref->doi
                </a></td></tr>";
            }
            if ($ref->zmath) {
            echo "<tr><td>ZMath:</td><td>
                <a href='http://zbmath.org/?q=an:$ref->zmath'>
                $ref->zmath</a></td></tr>";
            }
            if ($ref->arxiv) {
                echo "<tr><td>arXiv:</td><td>
                <a href='http://arxix.org/abs/$ref->arxiv'>
                $ref->arxiv</a></td></tr>";
            }
            ?>
        </table>
    </body>
</html>